<template>
    <div class="shop-wrap">
        <div class="box">
            <div class="header-top">
                <div class="shop-name">
                    <p>肯德基（天府新谷店）</p>
                    <div class="shop-sell">
                        <van-rate v-model="shopData.score" :size="20" color="#ffc300" void-icon="star" void-color="#eee" />
                        <span>(661)</span>
                        <span>月售{{ shopData.sellCount }}单</span>
                    </div>
                </div>
                <div class="heart" @click="isShow = !isShow">
                    <van-icon v-show="isShow" name="like" color="red" size="20" />
                    <van-icon v-show="!isShow" name="like" color="#ccc" size="20" />
                    
                    <p v-show="isShow">已收藏</p>
                    <p v-show="!isShow">收藏</p>
                </div>
                <div class="line"></div>
            </div>
        </div>
        <div class="shop-desc">
            <div class="shop-item">
                <span>起送价</span>
                <p>
                    <span class="money">{{ shopData.minPrice }}</span>元
                </p>
            </div>
            <div class="shop-item">
                <span>商家配送</span>
                <p>
                    <span class="money">{{ shopData.deliveryPrice }}</span>元
                </p>
            </div>
            <div class="shop-item">
                <span>平均配送时间</span>
                <p>
                    <span class="money">{{ shopData.deliveryTime }}</span>分钟
                </p>
            </div>
        </div>
        <div class="division">
            <div class="notice">
            <h1>活动与公告</h1>
            <p>
                {{ shopData.bulletin }}
            </p>
        </div>
        <div class="service">
            <div>
                <van-icon name="bullhorn-o" />
                <span>配送服务：</span>
                <span style="
                  color: #fff;
                  background: #ffc300;
                  fontsize: 12px;
                  padding: 2px 3px;
                ">美团专送</span>
                <span>提供高品质送餐服务</span>
            </div>
            <div class="time">
                <van-icon name="underway-o" />
                <span>配送时间：</span>
                <span>00:00 到 24:00</span>
            </div>
        </div>
        </div>
    </div>
</template>
  
<script>
import { getShopSellerReq } from "@/api/shop";

export default {
    data() {
        return {
            isShow: true,
            shopData: {
                name: "",
                avatar: "",
                bulletin: "",
                data: "",
                deliveryPrice: "",
                deliveryTime: "",
                description: "",
                minPrice: "",
                score: 5,
                sellCount: "",
                supports: "",
                
            },
        };
    },

    created() {
        this.getShopSeller();
    },

    methods: {
        async getShopSeller() {
            const res = await getShopSellerReq();
            this.shopData = res.data.data;
        },
    },
    
};
</script>
  
<style lang="scss" scoped>
.shop-wrap {
    color: #000;
    .box {
        padding: 0 5%;
        background: #fff;
        .header-top {
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #ccc;

            .shop-name {
               
                p {
                    margin-bottom: 5px;
                    color: #000;
                    font-size: 20px;
                }

                .shop-sell {
                    span {
                        color: #6a6a6a;
                        font-size: 14px;
                        margin-left: 10px;
                    }
                }
            }

            .heart {
                text-align: center;
                p {
                    color: #6a6a6a;
                    font-size: 14px;
                    margin-top: 5px;
                }
            }
        }
    }

    .shop-desc {
        padding: 20px 5%;
        display: flex;
        align-items: center;
        justify-content: space-around;
        // border-bottom: 20px solid #f4f5f7;
        background: #fff;
        .shop-item {
            text-align: center;
            color: #9b9b9b;
            
            p {
                font-size: 12px;
                margin-top: 10px;

                .money {
                    color: #000;
                    font-size: 24px;
                    margin-right: 3px;
                }
            }
        }
    }

    .division{
        margin-top:25px;
        // border: 1px solid red;
        background: #fff;
        .notice {
        padding: 0 5%;
        background: #fff;
        h1 {
            font-size: 20px;
            font-weight: normal;
            padding-top: 20px;
        }

        p {
            color: red;
            font-size: 14px;
            line-height: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #ccc;
            
        }
    }

    .service {
        padding: 0 5%;
        margin-top: 10px;
        background: #fff;
        padding-bottom: 300px;
        span {
            margin-left: 8px;
        }

        .time {
            margin-top: 10px;
        }
    }
    }

}
</style>
  